CC=g++

HEADER_PATH= -Itests/ -ID:/sdk/boost_1_55_0/
LIB_PATH= -L"D:/sdk/boost_1_55_0/stage/lib"
BOOST_LIBS=-lboost_system-mgw48-mt-1_55 -lboost_thread-mgw48-mt-1_55 -lboost_test_exec_monitor-mgw48-mt-1_55

CFLAGS=-c $(HEADER_PATH) -D_WIN32_WINNT=0x0501 -DWINVER=0x0501 -std=c++11 #-Wall
DFLAGS= $(LIB_PATH) $(BOOST_LIBS) -lws2_32 #-static-libgcc -static-libstdc++

OBJ=main.o match.o player.o frame.o frame_behaviour.o frame_controller.o #frame_test.o
CPP=main.cpp match.cpp player.cpp frame.cpp frame_behaviour.cpp frame_controller.cpp
TESTS=tests/tests.h tests/game_test.h tests/frame_test.h

# $^ - prerequisites
# $@ - target
# $< - first prerequisite
    
bin: $(OBJ)
	$(CC)  $^ $(DFLAGS) -o $@
 
main.o: main.cpp frame.h player.h player_bonus.h match.h pin_scheme.h turn.h frame_behaviour.h frame_controller.h stdfx.h $(TESTS)
	$(CC) $(CFLAGS) $<
    
match.o: match.cpp match.h player.h
	$(CC) $(CFLAGS) $<

player.o: player.cpp player.h player_bonus.h
	$(CC) $(CFLAGS) $<
    
frame.o: frame.cpp frame.h player_bonus.h turn.h    
	$(CC) $(CFLAGS) $<
    
frame_behaviour.o: frame_behaviour.cpp frame_behaviour.h
	$(CC) $(CFLAGS) $<
    
frame_controller.o: frame_controller.cpp frame_controller.h
	$(CC) $(CFLAGS) $<
    
#frame_test.o: tests/frame_test.cpp tests/frame_test.h
#	$(CC) $(CFLAGS) $<
                
clean:
	rm $(OBJ)